<?php 
	include '../init.php';
	$a=$_GET['a'];

	//接受当前页
	$p=$_GET['p'];

	$model=new Model('comments');
	switch ($a) 
	{
		case 'check':
			$where['id']=$_GET['id'];
			$status=$model->select($where);

			$data['status']=$status[0]['status']==0?1:0;

			$res=$model->update($data,$where);
			if ($res) 
			{
				header('location:'.ADMIN_URL.'/comments/index.php?p='.$p);
				return false;
			}
			break;
		
		
	}
?>